package com.xyd.servlet;

import com.xyd.entity.User;
import com.xyd.service.UserService;
import com.xyd.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 赵瑞硕
 * 用户管理根据用户ID获取用户信息
 */
@WebServlet("/userQueryServlet")
public class UserQueryServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String euUserId=request.getParameter("euUserId");
        UserService userService=new UserServiceImpl();
        User mcvList=userService.queryUser(euUserId);
        request.setAttribute("mcvList",mcvList);
        request.getRequestDispatcher("/manage/user-modify.jsp").forward(request,response);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
